#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a,b,c;
	int ans1,ans2,ans3,ans4,ans5,ans6,ans = 0;
	scanf("%d %d %d",&a,&b,&c);
	ans1 = a+b*c;
	ans = max(ans,ans1);
	ans2 = a*(b+c);
	ans = max(ans,ans2);
	ans3 = a*b*c;
	ans = max(ans,ans3);
	ans4 = (a+b)*c;
	ans = max(ans,ans4);
	ans5 = a*b+c;
	ans = max(ans,ans5);
	ans6 = a+b+c;
	ans = max(ans,ans6);
	printf("%d\n",ans);
}
